Fix SVM vlapic logic.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 28 Feb 2006 09:12:29 +0000 (10:12 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 28 Feb 2006 09:12:29 +0000 (10:12 +0100)
Signed-off-by: Tom Woller <thomas.woller@amd.com>
xen/arch/x86/hvm/svm/intr.c
xen/arch/x86/hvm/svm/svm.c

index 9ddaacee7aa5b35e8f8dbde26dfb10b2bd07dfb9..33f1c42c0637813e93dd6c21e563b18762191ec7 100644 (file)
@@ -80,12 +80,7 @@ interrupt_post_injection(struct vcpu * v, int vector, int type)
 {
     struct hvm_virpit *vpit = &(v->domain->arch.hvm_domain.vpit);
 
-    switch(type)
-    {
-    case VLAPIC_DELIV_MODE_EXT:
-    case VLAPIC_DELIV_MODE_FIXED:
-    case VLAPIC_DELIV_MODE_LPRI:
-        if ( is_pit_irq(v, vector, type) ) {
+    if ( is_pit_irq(v, vector, type) ) {
             if ( !vpit->first_injected ) {
                 vpit->first_injected = 1;
                 vpit->pending_intr_nr = 0;
@@ -95,12 +90,15 @@ interrupt_post_injection(struct vcpu * v, int vector, int type)
             }
             vpit->inject_point = NOW();
             svm_set_tsc_shift (v, vpit);
-        }
+    }
+
+    switch(type)
+    {
+    case VLAPIC_DELIV_MODE_EXT:
         break;
 
     default:
-        printk("Not support interrupt type: %d\n", type);
-        break;
+        vlapic_post_injection(v, vector, type);
     }
 }
 
index e4d1c6bf0990b5eb5f9f8a803776e41052de7211..45dcaf28a1fbc9eb7969706259c07706fb2b30ae 100644 (file)
@@ -810,7 +810,8 @@ void svm_relinquish_resources(struct vcpu *v)
     vpit = &v->domain->arch.hvm_domain.vpit;
     kill_timer(&vpit->pit_timer);
     kill_timer(&v->arch.hvm_svm.hlt_timer);
-    if ( hvm_apic_support(v->domain) ) {
+    if ( hvm_apic_support(v->domain) && (VLAPIC(v) != NULL) ) 
+    {
         kill_timer( &(VLAPIC(v)->vlapic_timer) );
         xfree( VLAPIC(v) );
     }